home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
176-200
/
scopedisk180
/
rxmenu2
/
arexxmenu.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-19
|
6KB
|
198 lines
/*****************************************************************/
/* ArexxMenu.rexx - Intuition based menu system for Amiga with */
/* AREXX and Dissidents Software Rx_Intui.library. */
/* */
/* Uses RunF1.rexx and Exec1.rexx macros to provide a simple */
/* facility for auto-running programs through the use of the */
/* FileIO file requestor and the RunF1 and Exec1 macros. */
/* RunF provides a CLI for running programs without .info files. */
/* This program checks for the .info file, if present then */
/* program runs in background. If the .info file is absent, */
/* then RunF1 is used to provide a CLI for output. */
/* */
/* © 1990 by Steven D. Kapplin */
/* Version 1.0 - 11/11/90 */
/*****************************************************************/
parse arg xpos ypos width height .
if xpos = "?" then do
say "SYNTAX: FastMenu1 <xpos> <ypos> <wid> <ht>"
say " xpos = x offset for window (default = 0)"
say " ypos = y offset for window (default = 150)"
say " wid = window width (min = 240, default = 240)"
say " ht = window height (min = 10, default = 10)"
exit 0
end
if width = "" | width < 240 then width = 240
if height = "" | height < 10 then height = 10
if xpos ="" then xpos = 150
if ypos ="" then ypos = 0
if ~exists('libs:rx_intui.library') then do
say 'rx_intui.library not in Libs: ... Aborting'
exit 10
end
if ~exists('libs:rexxsupport.library') then do
say 'RexxSupport.library not in Libs: ... Aborting'
exit 10
end
if ~show('L','rx_intui.library') then
call addlib('rx_intui.library',0,-30)
if ~show('L','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30)
wind=GetWindow(center('ARexx Menu',25),,xpos,ypos,width,height,,,4618)
IF wind == '' | wind == 0 THEN do
SAY 'Window open error'
exit 10
END
menu = AddMenu(wind,'Tools',0,90)
item = AddItem(menu,'New WShell','2',,,'W',wind)
item = AddItem(menu,'Editors',,,,,wind)
sub = AddSub(item,'Edit E','2',,,'E',wind)
sub = AddSub(item,'Edit CED','2',,,'C',wind)
item = AddItem(menu,'Print File','2',,,'P',wind)
item = AddItem(menu,'Disk Tools',,,,,wind)
sub = AddSub(item,'Dir Util',,,,,wind)
sub = AddSub(item,'Clean VD0:',,,,,wind)
sub = AddSub(item,'NewZap','2',,,'Z',wind)
sub = AddSub(item,'DC KF0:','2',,,'K',wind)
item = AddItem(menu,'GOMF',,,,,wind)
sub = AddSub(item,'Nuke',,,,,wind)
sub = AddSub(item,'Recall',,,,,wind)
item = AddItem(menu,'Flicker On/Off','03',,,,wind)
item = AddItem(menu,'Quit','2',,128+1,'Q',wind)
menu = AddMenu(wind,'DeskTop',100,90)
item = AddItem(menu,'Card Index','2',,,'A',wind)
item = AddItem(menu,'Calendar','2',,,'D',wind)
item = AddItem(menu,'Rollodex','2',,,'R',wind)
item = AddItem(menu,'Note Pad','2',,,'N',wind)
item = AddItem(menu,'Calculators',,,,,wind)
sub = AddSub(item,'Programmer',,,,,wind)
sub = AddSub(item,'Financial',,,,,wind)
sub = AddSub(item,'Scientific',,,,,wind)
menu = AddMenu(wind,'Applications',200,100)
item = AddItem(menu,'Terminal',,,,,wind)
item = AddItem(menu,'WordProcess',,,,,wind)
sub = AddSub(item,'ProWrite',,,,,wind)
sub = AddSub(item,'Excellence',,,,,wind)
item = AddItem(menu,'Spreadsheet',,,,,wind)
item = AddItem(menu,'Data Base',,,,,wind)
item = AddItem(menu,'Paint',,,,,wind)
item = AddItem(menu,'CanDo',,,,,wind)
menu = AddMenu(wind,'Devices',350,90)
item = AddItem(menu,'AutoExec',,,,,wind)
/* Loop until CLOSEWINDOW class (0), printing out all IDCMPspecs in the upper */
/* left corner. Note that the Quit Item will return a MENUPICK and then a CLOSEWINDOW. */
/* Observe the printout as you select and use gadgets and click the mouse. */
/* Start out CLASS = 1 before we get into the loop. */
class = 1
DO WHILE class > 0
spec=WaitMsg(wind)
PARSE var spec class menu item subitem
IF class = 2 then do
SELECT
WHEN menu = 0 then do
IF item = 0 then 'newwsh con:0/11/540/120/NewShell/c'
IF item = 1 & subitem = 0 then 'runwsh sys:Tools/E'
IF item = 1 & subitem = 1 then 'sys:CEdit'
IF item = 2 then 'runwsh sys:printutils/GWPrint'
IF item = 3 & subitem = 0 then 'runwsh sys:Utilities/PowerPlatform'
IF item = 3 & subitem = 1 then 'sys:System/DiskUtils/CleanRamDisk'
IF item = 3 & subitem = 2 then 'runwsh sys:System/DiskUtils/Zap'
IF item = 3 & subitem = 3 then 'DiskChange KF0:'
IF item = 4 & subitem = 0 then 'sys:System/Nuke'
IF item = 4 & subitem = 1 then 'sys:System/Recall'
IF item = 5 then 'runwsh c:AntiFlicker -c'
END
WHEN menu = 1 then do
IF item = 0 then 'runwsh sys:BigC/AmigaDex'
IF item = 1 then do
'cd sys:DeskTop/Organizers'
'runwsh sys:DeskTop/Organizers/Calendar'
END
IF item = 2 then do
'cd sys:DeskTop/Organizers'
'runwsh sys:DeskTop/Organizers/APB'
END
IF item = 3 then 'runwsh sys:BigC/MemoPad'
IF item = 4 & subitem = 0 then 'runwsh sys:DeskTop/Calculators/Programmer'
IF item = 4 & subitem = 1 then 'runwsh sys:DeskTop/Calculators/Financial'
IF item = 4 & subitem = 2 then 'runwsh sys:DeskTop/Calculators/Scientific'
END
WHEN menu = 2 then do
IF item = 0 then do
'cd Online!:'
'runwsh Online!:Online!'
END
IF item = 1 & subitem = 0 then do
'cd ProWrite:'
'runwsh ProWrite:ProWrite'
END
IF item = 1 & subitem = 1 then do
'cd Excellence!:'
'runwsh Excellence!:Excellence!'
END
IF item = 2 then do
'cd Advantage:'
'runwsh Advantage:Advantage -w'
END
IF item = 3 then do
'cd Filer:'
'runwsh Filer:FileIIsg'
END
IF item = 4 then do
'cd Dpaint:'
'runwsh Dpaint:Dpaint'
END
IF item = 5 then do
'cd CanDo:'
'runwsh CanDo:CanDo'
END
END
WHEN menu = 3 then do
cdir = pragma('D')
call FileReq(wind,cdir)
if path = '' then iterate
'Exec1 'path' 'wind''
END
OTHERWISE
END
END
END
err=EndWindow(wind)
exit
FileReq: procedure expose path
arg wind,cdir
err = MoveView(wind,6,90,240)
call delay(25)
fileio = GetFIO()
path = FioNW(fileio,'Choose File',128,,cdir,,,wind,20,20)
if ~exists(path) then do
path = ''
err = MoveView(wind,5,,)
err = Text("File Not Found",wind,5,30)
call delay(100)
end
err = EndFIO(fileio)
call delay(25)
err = MoveView(wind,6,-90,-240)
RETURN